<template>
  <div>
    <!-- 为 ECharts 准备一个定义了宽高的 DOM -->
    <div id="main" style="width: 1000px; height: 400px"></div>
  </div>
</template>
<script setup lang="ts">
import { echartsData } from './echarts'
import { ref, onMounted, onBeforeUnmount } from 'vue'
const remove = ref<() => void>()
onMounted(() => {
  console.log('创建')
  remove.value = echartsData()
})
onBeforeUnmount(() => {
  if (remove.value) {
    console.log('卸载')
  }
})
</script>
<style lang="scss"></style>
